//
//  PAWithdrawalsViewController.m
//  PAMobileWallet
//
//  Created by Pay_SMP002 on 13-7-4.
//  Copyright (c) 2013年 平安付. All rights reserved.
//

#import "PAWithdrawalsViewController.h"
#import "Global.h"
#import "PAWithdrawalsView.h"

#import "PASelectCardViewController.h"
#import "PAVerificationCodeViewController.h"

#import "PAPersonalViewController.h"

@interface PAWithdrawalsViewController ()

@end

@implementation PAWithdrawalsViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.title = @"提现";

        withdrawalsView = [[PAWithdrawalsView alloc] initWithFrame:RECT_PHONE];
        withdrawalsView.parentController = self;
        self.view = withdrawalsView;
    }
    return self;
}

- (void)testNext:(id)sender {
    int tag = [(UIButton *)sender tag];

    if (tag == 0) {
        if (!selectCardController) {
            selectCardController = [[PASelectCardViewController alloc] initWithNibName:nil bundle:nil];
            selectCardController.parentController = self;
        }
        [self.navigationController pushViewController:selectCardController animated:YES];
    }
    else if (tag == 1) {
        if (!verificationCodeController) {
            verificationCodeController = [[PAVerificationCodeViewController alloc] initWithNibName:nil bundle:nil];
            verificationCodeController.parentController = self;
        }
        [self.navigationController pushViewController:verificationCodeController animated:YES];
    }
}

- (void)goHome {
    for (PABaseViewController *controller in self.navigationController.viewControllers) {
        if ([controller isKindOfClass:[PAPersonalViewController class]]) {
            [self.navigationController popToViewController:controller animated:YES];
        }
    }
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
